Image representation and processing

The project is based on the use of classical image processing methods to solve the problem of creating a clean plate. On the basis of a set of photos taken on an identical background, objects that move are removed in such a way as to obtain a photo containing only the background.

Team members:

Note: The project is divided into sections in Google Colab, so it is recommended to open it there.

INITIALIZATION

Import needed libraries

Load datasets

"Cathedral" dataset

Our own dataset

For displaying data

Run the cell below in case of using Google Colab

Run following piece of code

(it is only for better text display purposes)

Resize image

FUNCTIONS

Display initial dataset look

(i.e., pictures containing moving objects and the reference)

Get statistics

Get dataset intensity distribution

Get average RGB distribution in a dataset

Background and foreground segmentation

Store initial dataset background colors

Create "base" image to fill the foreground on

Calculate MLE

Maximum Likelihood (Neighborhood) Estimation:

Method of estimating the parameters of an assumed probability distribution, given some observed data.

This is achieved by maximizing a likelihood function so that, under the assumed statistical model, the observed data is most probable.

Collect set of pixel color probabilities

Get final image

Fill in black-colored pixels

(i.e., left blank with colors obtained from background of picture above)

Average neighbor pixels for pixels left blank

(black in the picture above)

Apply neighbor averaging

MAIN

Run for "Cathedral" dataset

Run for our own dataset

CONCLUSIONS OF RESULTS AND ERRORS

The main error is incompleteness of resulting image (some pixels are left blank so that image seems "noisy"):

  • The blurring filter could be not fully correctly implemented;

Some minor pixel colors do not match with the reference image ones:

  • Applied approach minor bugs (e.e, in collecting background pixels colors or calculating their probabilities);

In case of images with less detailed background, just applying median could be enough (e.g., in our own dataset case).

REFERENCES

"Interactive Digital Photomontage" paper: http://grail.cs.washington.edu/projects/photomontage/photomontage.pdf